package car.aistar.controller;

import car.aistar.dto.XrbRecent;
import car.aistar.service.CarOverviewService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName SellDealXuController
 * @Description TODO 卖车界面最近成交车辆记录显示
 * @Author laoxu
 * @Date 2020/10/4 11:04
 * Version 1.0
 **/

@Controller
@RequestMapping("/DealXu")
public class SellDealXuController {


    @Autowired
    private CarOverviewService carOverviewService;

    @RequestMapping("/view")
    public String dealView(Model model, String pageNow, String pageSize){
        List<XrbRecent> xrbRecentList = carOverviewService.queryRecent();
//        pageNow = pageNow==null?"1":pageNow;
//        if(pageSize == null  || "-1".equals(pageSize)){
//            pageSize = "5";
//        }
//        PageInfo<XrbRecent> recentPageInfo= carOverviewService.findByPage(pageNow,pageSize);
//        model.addAttribute("page",recentPageInfo);

        model.addAttribute("xrbRecentList",xrbRecentList);
        return "sellCar/sellCar";
    }

}
